package xyz.itpath;

import liquibase.Liquibase;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.itpath.config.OssProperties;

import javax.sql.DataSource;

/**
 * @author zhaomengru
 * create by  2024/1/2 - 16:14
 */
@Configuration
@EnableConfigurationProperties(OssProperties.class)
public class OssConfig {

    @Bean
    public SpringLiquibase liquibase(DataSource dataSource) {
        SpringLiquibase springLiquibase = new SpringLiquibase();
        springLiquibase.setChangeLog("classpath:/db/changelog/oss/init.xml");
        springLiquibase.setDataSource(dataSource);
        return springLiquibase;
    }
}
